﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="SeeLiuyan.aspx.cs" Inherits="_Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
    <asp:GridView ID="GridView1" runat="server" Width = "100%" 
    BackColor="White"  PageSize = "5"
        BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="3" 
        AutoGenerateColumns="False" DataSourceID="SqlDataSource1" 
    onselectedindexchanged="GridView1_SelectedIndexChanged" 
        DataKeyNames="mid,repeate" onrowdatabound="GridView1_RowDataBound">
        <Columns>
            <asp:CommandField ShowSelectButton="True" />
            <asp:TemplateField>
                <ItemTemplate>
                    <table style="width: 100%; height: 100px; border: 5px solid #008080">
                        <tr>
                            <td>
                                <table style="width: 100%; height: 80px; ">
                                    <tr>
                                        <td bgcolor="#A5EDB4">
                                            <asp:Label ID="LbId" runat="server" Text='<%# Eval("mid", "第 {0}条留言") %>' 
                                                Width="100px"></asp:Label>
                                            <asp:Label ID="LbWriter" runat="server" Text='<%# Eval("writer", "作者：{0}") %>'></asp:Label>
                                        </td>
                                        <td>
                                        
                                            <table style="width: 700px; height: 80px ;" align ="right">
                                                <tr>
                                                    <td>
                                                        <table style="width: 100%">
                                                            <tr>
                                                                <td style = "width:600">
                                                                    <asp:Label ID="TitleLiuyan" runat="server" 
                                                                        Text='<%# Eval("title", "标题： {0}") %>' Height="20px" Width="700px" 
                                                                        BackColor="#FFCCFF"></asp:Label>
                                                                </td>
                                                                
                                                            </tr>
                                                        </table> 
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <asp:Label ID="LbLiuyan" runat="server" Text='<%# Eval("text") %>' 
                                                            Height="60px" Width="700px" BackColor="#FFCC99"></asp:Label>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td align ="right" bgcolor="#FFFFCC">
                                                        <asp:Label ID="LbTimeLiuyan" runat="server" Text='<%# Eval("time") %>' 
                                                            align ="right"></asp:Label>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Textbox ID="LbHuifuLiuyan" runat="server" 
                                    Text='<%# Eval("REPEATE", "管理员回复： {0}") %>' ReadOnly="True" 
                                    BorderStyle="None" Width="750px" BackColor="#CCFFFF"></asp:Textbox>
                            </td>
                        </tr>
                    </table>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <FooterStyle BackColor="White" ForeColor="#000066" />
        <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
        <RowStyle ForeColor="#000066" />
        <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
        <SortedAscendingCellStyle BackColor="#F1F1F1" />
        <SortedAscendingHeaderStyle BackColor="#007DBB" />
        <SortedDescendingCellStyle BackColor="#CAC9C9" />
        <SortedDescendingHeaderStyle BackColor="#00547E" />
        
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:graduate_manageConnectionString %>" 
        SelectCommand="SELECT [MESSAGE_HEAD] as title, [[MESSAGE _TEXT] as text, [MESSAGE _TIME] AS time, [MESSAGE_WRITER] as writer, [MESSAGE_ID] as mid, MESSAGE_REPEATE AS REPEATE FROM [MESSAGE] order by mid desc"
         DeleteCommand = " DELETE [MESSAGE] WHERE MESSAGE_ID = @MID">
    </asp:SqlDataSource>
    <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="delete" />
    <asp:Button ID="Button2" runat="server" onclick="Button2_Click" Text="repeat" />
</asp:Content>

